<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="layui/css/layui.css">
		<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
		<script type="text/javascript" src="layui/layui.all.js" ></script>
	</head>
	<body>
		<div class="layui-row layui-col-space20" style="margin: 20px 10px;">
			<div class="layui-row layui-bg-gray">
				<span class="layui-breadcrumb">
					<a href="javascript:toIndex();"><span class="layui-icon layui-icon-home"></span> 首页</a>
					<a href=""><span class="layui-icon layui-icon-template-1"></span> 基础信息管理</a>
					<a href="">公司职员管理</a>
				</span>
			</div>
			<div class="layui-row">
				<form class="layui-form" action="">
					<div class="layui-col-md4">
						<span>姓名</span>
						<div class="layui-input-inline">
							<input type="text" name="title" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-col-md4">
						<span>所在部门</span>
						<div class="layui-input-inline">
							<select id="selectId3">
								
							</select>
						</div>
					</div>
					<div class="layui-col-md1">
						<a class="layui-btn layui-btn-success" href="javascript:;">
							<span class="layui-icon layui-icon-search"></span>检索Search
						</a>
					</div>
				</form>
			</div>
			<div class="layui-card">
          	<div class="layui-card-body">
          		<table id="demo" lay-filter="test"></table>
          	</div>
          	<script type="text/html" id="buttonTpl">
          		<a class="layui-btn layui-bg-blue layui-btn-xs" lay-event="detail">编辑</a>
          		<a class="layui-btn layui-bg-warm layui-btn-xs" lay-event="detail">删除</a>
          	</script>
          </div>
         </div>
        <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
		<script src="layui/layui.all.js"></script>
		<script>
			layui.use(['element','form','laypage','table'],
			function(){
				var element = layui.element;
				var form = layui.form;
				var laypage = layui.laypage;
				var table=layui.table;
				/*laypage.render({
					elem:'pageId'
					,count:50
				});*/
				 table.render({
    elem: '#demo'
    ,height: 420
    ,url: 'dataJSON/company.json' //数据接口
    ,page: true //开启分页
    ,limit:5
    ,limits:[5,10,15,20]
    ,loading:false
    ,done:function(res,curr,count){
    	console.log(res,curr,count);
    }
    ,cols: [[ //表头
      {field: 'id', title: '员工编号', width:260, sort: true, fixed: 'left'}
      ,{field: 'name', title: '姓名', width:260}
      ,{field: 'class', title: '所在部门', width:260, sort: true}
      ,{field: 'desc', title: '上级', width:260} 
      ,{field: 'stadus', title: '操作', width:190,height:30,templet:'#buttonTpl'} 
     
    ]]
  });
   $(function(){	
			$.ajax({
				type:"get",
				url:"dataJSON/selectDict3.json",
				success:function(result){
					var seoption="";
					$.each(result.select,function(index,value){
						seoption+="<option>"+value+"</option>";
					})
					    console.log(seoption)
						$("#selectId3").append(seoption);
						form.render();
				    }
			});
			})	
});
		function toIndex(){
				$('#mainFrame').load('welcome.html');
			}
	</script>
	</body>
</html>
